#ifndef __THREAD_H__
#define __THREAD_H__


#ifdef _WIN32
#include <windows.h>

class Thread
{
public:
	Thread();
	virtual ~Thread();
public:
	void start();
	void stop();
	virtual void run()=0;
	static unsigned int __stdcall thread_func(void *p);
protected:
	bool mRun;
private:
	HANDLE mHandle;
};

#else

#include <pthread.h>

class Thread
{
public:
	Thread();
	virtual ~Thread(){}
	void start();
	void stop();
protected:
	virtual void run()=0;
	bool mRun;
private:
	static void *thread_func(void *p);
	pthread_t mThreadId;
};

#endif


#endif